Function Subspace :: _r literal
Constructs a usize
range from a literal.
The constructed range satisfies the RangeBounds<usize>
concept. Because usize
is unsigned, numbers may not be negative.
The syntax is a string (in double quotes) containing:
start..end
for a range including start and excluding end. This returns asus::ops::Range<usize>
.start..=end
for a range including start and including end. This returns asus::ops::Range<usize>
.start..
for a range including start and never ending. This returns asus::ops::RangeFrom<usize>
...end
for a range including everything up end. This returns asus::ops::RangeTo<usize>
...=end
for a range including everything up and including end. This returns asus::ops::RangeTo<usize>
...
for a range that has no bounds at all. Typically for a slicing range to indicate the entire slice. This returns asus::ops::RangeFull<usize>
.
Examples
sus_check("1..4"_r).start == 1u);
sus_check(("1..4"_r).finish == 4u);
sus_check(("1..=4"_r).finish == 5u);